﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//using System.Web.;
using System.Web.Services;
using BLL;
using System.Collections;

namespace GeniusWebApplication
{
    public partial class log : System.Web.UI.Page
    {
        //string aaa = Application.StartupPath;
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        [WebMethod]
        public static string ajaxLogUser(string username, string password)
        {
            UserService userService = new UserService();
            Hashtable ht = userService.login(username, password);
            string result = (string)ht["result"];
            string message = (string)ht["message"];
            //登陆
            HttpContext.Current.Session.Add("user", userService.getUserByEmail(username));

            return "{" + 
                        "result:'" + result + "'," +
                        "message:'" + message + "'" +
                    "}";
        }
    }
}